import request from '@/utils/request'

// 获取部门列表
export const getDepartmentsListApi = () => {
  return request({
    url: '/company/department'
  })
}
/**
 * 根据id删除部门
 * **/
export function delDepartmentsApi(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

// 调用负责人
export const getUserSimpleListApi = () => {
  return request({
    url: '/sys/user/simple'
  })
}

// 添加部门
export const addDepartmentApi = form => {
  return request({
    url: '/company/department',
    method: 'post',
    data: form
  })
}

// 获取部门详情
export const getDepartmentDetailApi = id => {
  return request({
    url: `/company/department/${id}`
  })
}

// 修改数据
export const editDepartmentApi = data => {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data: data
  })
}
